package resourcePool

import (
	"encoding/json"
	"gitee.com/dongmingchao/decent-ft/src/JSlike"
	"gitee.com/dongmingchao/decent-ft/src/utils"
)

type GNeighbor struct {
	GTree
	RemoteAddr *utils.UDPAddr
	BridgeAddr *utils.UDPAddr
	Bypass     string
	DivePass   []string
}

func (t GNeighbor) BeforeMarshal() JSlike.Object {
	super := t.GTree.BeforeMarshal()
	super["RemoteAddr"] = t.RemoteAddr
	super["Bypass"] = t.Bypass
	return super
}

func (t GNeighbor) MarshalJSON() ([]byte, error) {
	return json.Marshal(t.BeforeMarshal())
}
